home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 2.toast / pc / sample code / overview / dtscpluslibrary / headers / colorpicker.h < prev    next >
Encoding:
Text File  |  2000-09-28  |  2.5 KB  |  77 lines

  1. /*
  2.     File:        ColorPicker.h
  3.  
  4.     Contains:    TColorPicker is a simple color picker utility class    
  5.                   TColorPicker.h contains the TColorPicker class definitions. 
  6.  
  7.     Written by: Kent Sandvik    
  8.  
  9.     Copyright:    Copyright © 1993-1999 by Apple Computer, Inc., All Rights Reserved.
  10.  
  11.                 You may incorporate this Apple sample source code into your program(s) without
  12.                 restriction. This Apple sample source code has been provided "AS IS" and the
  13.                 responsibility for its operation is yours. You are not permitted to redistribute
  14.                 this Apple sample source code as "Apple sample source code" after having made
  15.                 changes. If you're going to re-distribute the source, we require that you make
  16.                 it clear in the source that the code was descended from Apple sample source
  17.                 code, but that you've made changes.
  18.  
  19.     Change History (most recent first):
  20.                 8/18/1999    Karl Groethe    Updated for Metrowerks Codewarror Pro 2.1
  21.                 
  22.  
  23. */
  24.  
  25.  
  26. // Declare label for this header file
  27. #ifndef _COLORPICKER_
  28. #define _COLORPICKER_
  29.  
  30. #ifndef _DTSCPLUSLIBRARY_
  31. #include "DTSCPlusLibrary.h"
  32. #endif
  33.  
  34. // TOOLBOX HEADERS
  35. #ifndef __COLORPICKER__
  36. #include <ColorPicker.h>
  37. #endif
  38.  
  39. #ifndef __QUICKDRAW__
  40. #include <Quickdraw.h>
  41. #endif
  42.  
  43. // _________________________________________________________________________________________________________ //
  44. //    TColorPicker Class Interface.
  45. class TColorPicker
  46. {
  47. public:
  48.     // CONSTRUCTORS AND DESTRUCTORS
  49.     TColorPicker(Boolean keepTrack = true);
  50.     virtual~ TColorPicker();
  51.  
  52.     // MAIN INTERFACE
  53.     virtual Boolean Select(Str255 string = "\p");// select an RGB value
  54.     virtual void Reset();                        // reset so the initial color is white
  55.     virtual RGBColor GetSelectedColor() const;    // return RGB value of earlier Select
  56.     virtual CMYColor GetSelectedCMYColor();        // return CMY value of earlier Select
  57.     virtual HSLColor GetSelectedHSLColor();        // return HSL value of earlier Select
  58.     virtual HSVColor GetSelectedHSVColor();        // return HSV value of earlier Select
  59.  
  60.     // FIELDS
  61. protected:
  62.     Boolean fKeepTrack;                            // enable if we want to keep track of earlier selected color
  63.     RGBColor fInitialColor;                        // initially set RGBvalue (if fKeepTrack is true)
  64.     RGBColor fSelectedColor;                    // keeps the latest selected value
  65.     Point fDialogPoint;                            // dialog point for the color picker
  66. };
  67.  
  68. #endif
  69.  
  70. // _________________________________________________________________________________________________________ //
  71.  
  72. /*    Change History (most recent last):
  73.   No        Init.    Date        Comment
  74.   1            khs        1/3/93        New file
  75.   2            khs        1/5/93        Cleanup
  76. */
  77.